import java.util.Date;

public class Main {
    public static int[][] tri={{0,1,0,0,0},{0,3,2,0,0},{0,4,10,1,0},{0,4,3,2,20}};
    public static int dfsTirCount=0;

    public static int imax(int a,int b){
        return Math.max(a,b);
    }

    public static int dfsTir(int i, int j, int n){
        dfsTirCount++;
        return tri[i][j] + (i == n ? 0 : imax(dfsTir(i+1,j,n),dfsTir(i+1,j+1,n)));
    }

    public static void main(String[] args) {
        System.out.println(dfsTir(0, 1, 3));
        System.out.println(dfsTirCount);
    }
}